package demo1;

//牛客网:游游的水果大礼包

import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextInt(); //苹果
        long m = in.nextInt(); //桃子
        long a = in.nextInt();
        long b = in.nextInt();

        long ret = 0;
        if(a > b) {
            long k = Math.min(n/2, m);
            n -= k*2;
            m -= k;
            ret += k*a;

            k = Math.min(n,m/2);
            ret += k*b;
        }else {
            long k = Math.min(n,m/2);
            n -= k;
            m -= k*2;
            ret += k*b;

            k = Math.min(n/2,m);
            ret += k*a;
        }

        System.out.println(ret);
    }
}

/*

2 1 a
1 2 b

7  5 1 2
5  1  k:2 ret+= 4
3  0  k:1 ret+= 1

*/